Skip to main content

All Questions

1vote
1answer
285views

Angular Unit Testing: Isolate certain components defined on module

I've inherited a large AngularJS project using Karma and Jasmine and am trying to follow the conventions that were set out before me, but am having trouble unit testing directive/controller modules. ...
seansean11's user avatar
1vote
1answer
692views

How to test a directive which uses ngModel on same element

I have a directive which requires ngModel. In its link function it calls $setViewValue on the ngModel controller. I want to test that $setViewValue is being called under the right conditions, but I ...
Heather Roberts's user avatar
0votes
0answers
55views

Unit testing controller triggering custom directive

Suppose you have an angular+jasmine app and your controller looks something like this: app.controller('MyController', function($scope) { $scope.myFunc = function() { $scope.myArray = []; ...
r_31415's user avatar
  • 8,982
0votes
0answers
221views

How do I properly initialize/mock and unit test input data in a directive's externally-defined controller?

I have a custom directive that uses an external controller and template. The user passes in some initial data to the directive, which is used inside the controller. When I'm unit testing ...
chazzlabs's user avatar

close